home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-07 | 5.1 KB | 171 lines | [TEXT/KEEN] |
- Read Resource manual
- Copyright © 1991 Dynabyte. You can redistribute or modify
- this file under the terms of the GNU General Public License as published by
- the Free Software Foundation (see the file “COPYING hAWK”).
-
- This is an illustrated TEXT document. If you're not using EnterAct to view this,
- you won't see the pictures - but you'll still get the idea. Major topics are marked
- with MPW-compatible marks, typically accessed by holding down the
- <Option> or <Command> key and clicking in the title bar of this window.
-
- EnterAct is named as the calling application below, but the operation is the same
- for any calling application—only the name of the menu that you pick
- Read Resource from will differ.
-
- Contents
- --------
- Overview
- Installation
- Using Read Resource
-
- ---------
- Overview
- ---------
- Read Resource is packaged as a ResEdit resource file, and you'll find it in the "Drag_on
- Modules" folder after decompressing the “Drag_on Modules.sea” file on disk 2. There's
- a file called “Installing EnterAct” on disk 1 that explains how to decompress and install
- everything. The decompressed folder looks like this:
-
-
-
-
-
-
-
-
-
-
-
-
- Read Resource is not a stand-alone application, but is rather a CODE resource which
- can be called from a full-fledged application. EnterAct is such an application, and
- complete instructions are included for calling Read Resource or any other Drag_on
- Module from your application if the notion intrigues you. See the “hAWK User’s
- Manual” towards the end, “Calling hAWK from your application”. The instructions
- there detail how to call any Drag_on Module from your application.
-
- Drag_on Modules are rather like MPW tools, or HyperCard XCMD's, in that they focus
- on doing one specifc task, and rely on a calling application to do some of the routine work.
- Communication between the calling application and the module is primarily through
- TEXT files, a simpler version of the standard input/output concept in shells such as
- MPW and in the standard C libraries.
-
- Read Resource will read a resource or the entire data fork from any (closed) file,
- format the results in a general way, and write the results to the file "$tempStdOut". If
- Read Resource is called through EnterAct, you will be shown "$tempStdOut".
-
- Read Resource is mainly useful for displaying and verifying the contents of a resource
- or data fork that your own application has created. Although the raw result from Read
- Resource is useful in itself, you can with just a bit of work write a little hAWK
- program to take the results from Read Resource and format the results to your liking,
- as well as verifying the contents of the resource or data fork. The tough part has been
- done for you, in the sample hAWK program "$Print_MENU_Resource", which
- contains the functions you’ll need to format and display your own custom resources.
-
- ----------
- Installation
- ----------
- Well, if you’re reading this then you’ve already installed Read Resource, and
- the results should look something like this:
-
-
-
-
-
-
-
-
-
-
-
- Details: Read Resource must be in a folder called "Drag_on Modules", and this folder must
- be in the same folder as THINK C and EnterAct, at the same level, in order for EnterAct to
- detect it. Nothing else needs to be anywhere. This policy is recommended for any other
- application that wishes to call Drag_on Modules.
-
- To verify that EnterAct has picked up the presence of your Drag_on Modules, start up
- EnterAct: you should see your installed Modules listed at the bottom of the "EnterAct"
- menu.
-
- ----------------
- Using Read Resource
- ----------------
- Before calling Read Resource, you should know the resource type and id number that you
- want to view.
-
- Select "Read Resource" from the "EnterAct" menu within EnterAct. You will be shown
- a standard Open dialog asking you to pick the file from which to take the resource or
- data fork.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Next, you'll see a dialog asking you to type in the resource type and id. To
- specify the data fork, enter a type of "data", and an id of "0"(zero).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- After clicking OK, the contents of the resource or data fork will be formatted and saved
- to the file "$tempStdOut". Note the "temp" in this file name is to remind you that the
- contents of this file are routinely overwritten by Drag_on Modules, so if you want a
- permanent version of the results you should use "Save As..." to save the file under a
- different name. EnterAct will display the contents of "$tempStdOut" at the end.
-
- What you get looks something like this: (a MENU resource)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The format is: starting byte number (zero-based); followed by four groups of 4-byte
- chunks of data displayed as hex numbers, two hex digits per byte; followed by a rough
- ASCII version of the data, with a period taking the place of any characters that don't
- seem to be ASCII. The same format is used for display of a data fork. The last line of the
- listing will be padded out with zeroes to make up a full four groups of hex numbers, but
- the ASCII equivalent will not be padded.
-
- The only significant restriction on Read Resource is that it will refuse to do anything with
- an open file. This includes the system, and the calling application, and Read Resource itself.